package com.wjw.bms.controller;

import java.util.List;

import org.codehaus.jettison.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wjw.bms.model.HzMenu;
import com.wjw.bms.service.HzMenuService;

@Controller
@RequestMapping("/menu")
public class HzUserMenuController {
	
	@Autowired
	private HzMenuService hzMenuService;
	
	@RequestMapping("getHzMenu")
	@ResponseBody
	public List<HzMenu> getHzMenu() {
		List<HzMenu> menuList = hzMenuService.getHzMenu();
		return menuList;
	}
	
	@RequestMapping("getPreviousMenu")
	@ResponseBody
	public List<HzMenu> getPreviousMenu(){
		List<HzMenu> previousMenuList = hzMenuService.getHzPreviousMenu();
		return previousMenuList;
	}
	
	@RequestMapping("getHzTreeMenu")
	@ResponseBody
	public JSONObject getHzTreeMenu(){
		JSONObject treeJson = hzMenuService.getHzTreeMenu();
		return treeJson;
	}
}
